//
//  NetworkTool.swift
//  HeadlineNews
//
//  Created by han on 2019/6/5.
//  Copyright © 2019 han. All rights reserved.
//

import Foundation
import Alamofire

let BASE_URL = "https://is.snssdk.com"
let device_id: String  = "6096495334"
let iid: String = "5034850950"

protocol NetworkToolProtocol {
    
    // MARK: 我的 Mine
    
    static func loadMyCellData(completionHandler: @escaping (_ sections: [[MyCellModel]]) -> () )
}

extension NetworkToolProtocol {
    
    // MARK: 我的 Mine
    
    static func loadMyCellData(completionHandler: @escaping (_ sections: [[MyCellModel]]) -> () ) {
        let url = BASE_URL + "/user/tab/tabs/?"
        let params = ["device_id": device_id]
        
        Alamofire.request(url, method: .post, parameters: params, encoding: JSONEncoding.default, headers: nil).responseJSON { (response) in
            guard response.result.isSuccess else { return }
            if let value = response.result.value {
                print("请求我的列表:\(value)")
            }
        }
    }
}
